ramdisk: headless planning, staging, mounts, recovery + tokenized CLI (PR2 of #377 split) - #821
Draft
BColsey wants to merge 3 commits into
Draft
ramdisk: headless planning, staging, mounts, recovery + tokenized CLI (PR2 of #377 split)#821BColsey wants to merge 3 commits into
BColsey wants to merge 3 commits into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
…d CLI from donor 5f6f31a Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Aug 4, 2026
…dless contracts, textual extra) PR2 excludes the UI/benchmark/curses/monitor modules but still required them, so the launcher aborted (SystemExit) and presentation.py failed to import. Reconstruct the headless control plane so it builds and tests green with those modules physically absent. - coli _complete_support: split REQUIRED vs OPTIONAL bundle members (ramdisk_ui/ramdisk_textual/benchmark/curses_ui/runtime_monitor). A missing OPTIONAL member now warns, never aborts; only the core headless modules remain required. contracts.py is a new required headless member. - ramdisk_support/contracts.py (new): headless home for the data contracts previously imported from the excluded ramdisk_ui (PlacementContract, ActionPolicy, DeploymentHealth, HealthLevel, ReviewIdentity, plus ActionPermission/ReviewAction). presentation.py imports from .contracts and no longer touches any UI module. - ramdisk.py: optional lazy accessors (_benchmark/_curses/_textual_module) raise a clear RamdiskError only when the feature is actually used, not at import/collection time. __all__/__dir__ exclude optional exports when the backing module is absent so 'from ramdisk import *' stays clean headless. - Relocate two pure core utilities that were trapped in optional bundles: _normalized_runtime_knobs (needed by lifecycle.start) and _TuiTerminationSignal (a signal carrier used by mount/state tests) into ramdisk_support/common.py so the core path is headless. - pyproject.toml: move textual from a hard dependency to an optional 'tui' extra; keep requires-python>=3.10 and setuptools>=77.0.1. Restore requirements-tui.txt as the tui extra pin file. - Tests adapted to the headless reality: packaging fixtures copy/assert the headless bundle; optional-feature tests skip when their module is absent; JSON-pipeline tests tolerate the benign headless launcher notice; the platform skip inventory drops references to absent test modules. Verified: cd c && python3.10 -m unittest discover -s tests -p test_*.py -> Ran 725 tests, OK (skipped=20). COLIBRI_TEST_TARGET_PLATFORM=win32 -> Ran 725 tests, OK (skipped=58), no NameError. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft successor — supersedes #377. One of three dependent PRs reconstructed from the frozen green donor
5f6f31a. Do not merge #377.docs/superpowers/specs/2026-08-01-pr-377-stabilization-design.md(PR2, L82-87)docs/superpowers/specs/2026-08-02-pr-377-successor-reconstruction.mdScope
Headless planning/discovery, platform ops, durable state, safe mount recovery, the reduced facade + tokenized CLI, packaging, and portable tests. No frontend/TUI; managed
start/stopdeferred to PR3.Control plane:
c/ramdisk.py,c/__init__.py,c/ramdisk_support/{__init__,accelerator,cli,common,discovery,lifecycle,linux_ops,model,mounts,planning,platform_ops,presentation,presets,processes,state}.py. Packaging:c/coli,c/tools/clean.py,pyproject.toml,flake.nix. Portable tests (state_lifecycle, processes, mounts, planning, platform, packaging, CLI/JSON smoke, facade, …) + docs/CI.Reconstruction work (drafts may not build in isolation until these land)
plan/stage --plan-token/ read-onlyverify/status/destroy --deployment-token, all--json; versioned result/error schemas.preparestays an alias; managedstart/stopstay deferred to PR3.presentation.pyimportsramdisk_uiat module top level — relocate the data contracts + token builders into a headlessramdisk_supportmodule so PR2 builds withramdisk_ui/ramdisk_textual/curses_uiphysically absent.textualas a hardpyproject.tomldep (→tuiextra); stopc/coliandflake.nixfrom requiring/bundling UI files; updatetest_ramdisk_packaging.pybundle assertions.Dependency
Depends on PR1 (#820):
c/coliimportsresource_plan.py(PR1). PR3 (#822) depends on this PR's durable state + recovery.Build verification (subagent worktree)
lifecycle/state/processesimport cleanly. 233 passed / 36 failed — every failure traces to the intentionally-excluded UI/benchmark/curses bundle (no unexpected defect).presentation.py:10importingramdisk_ui— thecolilauncher top-level bundle self-check (_complete_support, c/coli:67-162) hard-aborts withSystemExit("coli: incomplete colocated support bundle …")whenramdisk_ui.py/ramdisk_textual.py/benchmark.py/curses_ui.py/runtime_monitor.pyare absent, killing the unittest runner. PR2 must make that self-check absence-tolerant (and have the lazyimportlibaccessors treat a missing optional module as "feature unavailable", not a hard abort).Reconstruction update
PR2 reconstruction landed (commit b7a6df4): builds and tests UI-free. Absence-tolerant
colibundle self-check (no SystemExit); new headlessramdisk_support/contracts.py(contracts relocated out of the excludedramdisk_ui);presentation.pyimports from.contracts;textualmoved to an optionaltuiextra; lazy accessors raise only on use. Green: 705 passed / 0 failed (3.10 + Win32 matrix). Still TODO: tokenized JSON CLI (stage/verify/destroy).